package com.asa.navigationdempo

import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.asa.navigationdempo.databinding.FragmentABinding
import java.io.Serializable

class FragmentA: Fragment() {

    private lateinit var binding:FragmentABinding

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        binding = FragmentABinding.inflate(inflater,container,false)
        return binding.root

    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
//        arguments?.apply {
//            val student = getSerializable("student") as Serializable
//            Log.e("日志", "onViewCreated: student:${student}")
//        }
        arguments?.apply {
            val student = FragmentAArgs.fromBundle(this).student
            Log.e("日志", "onCreate: student:${student}")
        }
    }

}